<template>
  <yd-layout class="m-order">
    <!-- 顶部导航 -->
    <yd-navbar slot="navbar" title="我的订单" height=".88rem" bgcolor="#fff" color="#444" fontsize=".3rem">
      <yd-navbar-back-icon slot="left" color="#666" @click.native="$router.back()"></yd-navbar-back-icon>
    </yd-navbar>

    <!-- tab -->
    <w-tab @changePage="onChangeTab" :indexTab="orderType">
      <w-tab-panel label="全部" hash="1">
        <h1>1</h1>
      </w-tab-panel>
      <w-tab-panel label="待付款" hash="2">
        <h1>2</h1>
      </w-tab-panel>
      <w-tab-panel label="待发货" hash="3">
        <h1>3</h1>
      </w-tab-panel>
      <w-tab-panel label="待收货" hash="4">
        <h1>4</h1>
      </w-tab-panel>
      <w-tab-panel label="待评价" hash="5">
        <h1>5</h1>
      </w-tab-panel>
    </w-tab>
  </yd-layout>
</template>

<script>
  export default {
    data() {
      return {
        orderType: '1'
      }
    },
    created() {
      this.orderType = this.$route.query.type
    },
    methods: {
      onChangeTab(index) {
        const idx = index + 1
        console.log(idx)
      }
    }
  }
</script>

<style lang="scss">
  .m-order {
    
  }
</style>